﻿using Omniscient.Foundation.Data;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Omniscient.TimeTracker.Data
{
    public class Project : EntityBase
    {
        public Project()
            :base()
        {
            Tasks = new EntityList<Task>();
        }

        public Project(Guid id, bool entityIsLoaded)
            : base(id, entityIsLoaded)
        { 
            Tasks = new EntityList<Task>(); 
        }

        /// <summary>
        /// This constructor is use to create a new project that will be inserted into database
        /// </summary>
        /// <param name="name"></param>
        /// <param name="parent"></param>
        public Project(string name)
            :this(name, DateTime.Now)
        {}

        private Project(string name, DateTime startDate)
        {
            Name = name;
            StartDate = startDate;
            Tasks = new EntityList<Task>();
        }

        public string Name { get; set; }
        public string Description { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public EntityList<Task> Tasks { get; private set; }

        public Client ParentClient { get; set; }
    }

}
